using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Presenters;
using Dominio;

public partial class NewBug : AbstractView
{
    private BugDestailsPresenter presenter;
    private User user;
    public NewBug()
    {
        presenter = new BugDestailsPresenter();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack) return;

        this.LogedIn();
        presenter = new BugDestailsPresenter();
        String relId = Request.QueryString.Get("releaseId");
        releaseIdtext.Text = relId;
        bugTypeDrop.DataSource = Enum.GetNames(typeof(BugTypeEnum));
        bugTypeDrop.DataBind();
        user = (Tester)Session["user"];
        testerIdtxt.Text = user.Id.ToString();
    }
    protected void Update_Click(object sender, EventArgs e)
    {
        presenter.SaveBug(bugdescripttxt.Value, bugSotxt.Text, Soversiontxt.Text, bugTypeDrop.Text, int.Parse(releaseIdtext.Text), int.Parse(testerIdtxt.Text));
                                                                                                                                   
    }
}
